package com.action;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts2.interceptor.ServletRequestAware;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import com.opensymphony.xwork2.ActionSupport;

@Component("urlforwardAction")
@Scope("prototype")
public class UrlForward extends ActionSupport implements ServletRequestAware {
	private HttpServletRequest request;
	private String urlMethod;

	public String getUrlMethod() {
		return urlMethod;
	}

	public void setUrlMethod(String urlMethod) {
		this.urlMethod = urlMethod;
	}

	public void setServletRequest(HttpServletRequest request) {
		this.request = request;
	}

	public String actionForward() {
		if(urlMethod == "exalist" || urlMethod.equals("exalist")){
			return "exalist";
		}else if(urlMethod == "tempfilelist" || urlMethod.equals("tempfilelist")){
			return "tempfilelist";
		}else if(urlMethod == "minfolist" || urlMethod.equals("minfolist")){
			return "minfolist";
		}else if(urlMethod == "newslist" || urlMethod.equals("newslist")){
			return "newslist";
		}else if(urlMethod == "urgencylist" || urlMethod.equals("urgencylist")){
			return "urgencylist";
		}else if(urlMethod == "hall" || urlMethod.equals("hall")){
			return "hall";
		}else if(urlMethod == "exajsp" || urlMethod.equals("exajsp")){
			return "exajsp";
		}
		return "1";
	}
}
